From: kfraser@localhost.localdomain Date: Thu, 30 Aug 2007 14:00:21 +0000 (+0100) Subject: Introduce xc_core_arch_gpfn_may_present() hook. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14987^2~44 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=75dabf614d9c2b0884352ae20861a807f09af022;p=xen.git Introduce xc_core_arch_gpfn_may_present() hook. On ia64 trying to map a foreign domain page which isn't allocated cause annoying warning message. xm dump-core results in too many warnings. With this hook, ia64 dump-core can suprress warning. Signed-off-by: Isaku Yamahata --- diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 9ddbfef418..b404730800 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -474,8 +474,9 @@ xc_domain_dumpcore_via_callback(int xc_handle, } /* obtain memory map */ - sts = xc_core_arch_memory_map_get(xc_handle, &info, live_shinfo, - &memory_map, &nr_memory_map); + sts = xc_core_arch_memory_map_get(xc_handle, &arch_ctxt, &info, + live_shinfo, &memory_map, + &nr_memory_map); if ( sts != 0 ) goto out; @@ -756,6 +757,9 @@ xc_domain_dumpcore_via_callback(int xc_handle, } else { + if ( !xc_core_arch_gpfn_may_present(&arch_ctxt, i) ) + continue; + gmfn = i; pfn_array[j] = i; } diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h index 278be895dd..c15729e5af 100644 --- a/tools/libxc/xc_core.h +++ b/tools/libxc/xc_core.h @@ -133,8 +133,10 @@ struct xc_core_memory_map { }; typedef struct xc_core_memory_map xc_core_memory_map_t; int xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info); -int xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info, - shared_info_t *live_shinfo, +struct xc_core_arch_context; +int xc_core_arch_memory_map_get(int xc_handle, + struct xc_core_arch_context *arch_ctxt, + xc_dominfo_t *info, shared_info_t *live_shinfo, xc_core_memory_map_t **mapp, unsigned int *nr_entries); int xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info, diff --git a/tools/libxc/xc_core_ia64.c b/tools/libxc/xc_core_ia64.c index 89c1053886..e092d6f69f 100644 --- a/tools/libxc/xc_core_ia64.c +++ b/tools/libxc/xc_core_ia64.c @@ -158,8 +158,8 @@ memory_map_get_old(int xc_handle, xc_dominfo_t *info, } int -xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info, - shared_info_t *live_shinfo, +xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused, + xc_dominfo_t *info, shared_info_t *live_shinfo, xc_core_memory_map_t **mapp, unsigned int *nr_entries) { diff --git a/tools/libxc/xc_core_ia64.h b/tools/libxc/xc_core_ia64.h index 6357dfa20e..03cd8e0182 100644 --- a/tools/libxc/xc_core_ia64.h +++ b/tools/libxc/xc_core_ia64.h @@ -46,6 +46,7 @@ xc_core_arch_context_get_shdr(struct xc_core_arch_context* arch_ctxt, int xc_core_arch_context_dump(struct xc_core_arch_context* arch_ctxt, void* args, dumpcore_rtn_t dump_rtn); +#define xc_core_arch_gpfn_may_present(arch_ctxt, i) (1) #endif /* XC_CORE_IA64_H */ diff --git a/tools/libxc/xc_core_powerpc.c b/tools/libxc/xc_core_powerpc.c index a29fdb83b3..dd8f26b371 100644 --- a/tools/libxc/xc_core_powerpc.c +++ b/tools/libxc/xc_core_powerpc.c @@ -43,8 +43,8 @@ xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info, } int -xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info, - shared_info_t *live_shinfo, +xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused, + xc_dominfo_t *info, shared_info_t *live_shinfo, xc_core_memory_map_t **mapp, unsigned int *nr_entries) { diff --git a/tools/libxc/xc_core_powerpc.h b/tools/libxc/xc_core_powerpc.h index ce8aaf17c5..2f39413c4d 100644 --- a/tools/libxc/xc_core_powerpc.h +++ b/tools/libxc/xc_core_powerpc.h @@ -33,6 +33,7 @@ struct xc_core_arch_context { #define xc_core_arch_context_get(arch_ctxt, ctxt, xc_handle, domid) \ (0) #define xc_core_arch_context_dump(arch_ctxt, args, dump_rtn) (0) +#define xc_core_arch_gpfn_may_present(arch_ctxt, i) (1) static inline int xc_core_arch_context_get_shdr(struct xc_core_arch_context *arch_ctxt, diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c index 3932f8e96b..4aa825b87d 100644 --- a/tools/libxc/xc_core_x86.c +++ b/tools/libxc/xc_core_x86.c @@ -33,8 +33,8 @@ xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info) } int -xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info, - shared_info_t *live_shinfo, +xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused, + xc_dominfo_t *info, shared_info_t *live_shinfo, xc_core_memory_map_t **mapp, unsigned int *nr_entries) { diff --git a/tools/libxc/xc_core_x86.h b/tools/libxc/xc_core_x86.h index 53ca48493d..6e3490bb27 100644 --- a/tools/libxc/xc_core_x86.h +++ b/tools/libxc/xc_core_x86.h @@ -40,6 +40,7 @@ struct xc_core_arch_context { #define xc_core_arch_context_get(arch_ctxt, ctxt, xc_handle, domid) \ (0) #define xc_core_arch_context_dump(arch_ctxt, args, dump_rtn) (0) +#define xc_core_arch_gpfn_may_present(arch_ctxt, i) (1) static inline int xc_core_arch_context_get_shdr(struct xc_core_arch_context *arch_ctxt,